package com.atguigu.ossservice.controller;

import com.atguigu.commonutils.R;
import com.atguigu.ossservice.service.FileService;
import com.atguigu.servicebase.VO.BookQueryVo;
import com.atguigu.servicebase.VO.FrontVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.awt.print.Book;

/**
 * @program: book-shore
 * @description
 * @author: Pudding
 * @create: 2020-05-28 11:27
 **/

@RestController
@CrossOrigin
@RequestMapping("/upload/ossservice")
public class FileUploadController {
    @Autowired
    private FileService fileService;


    /**
     * 文件上传
     */
    @PostMapping("uplaodfile")
    private R uplaodfile(@RequestBody MultipartFile file){
        String uploadurl = fileService.upload(file);
        return R.ok().message("文件上传成功！").data("uploadurl",uploadurl);
    }



}
